using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Attachments
{
    /// <summary>
    /// <para>Add Attachments</para>
    /// <para>Adds file attachments to the records of a geodatabase feature class or table. The attachments are stored internally in the geodatabase in a separate attachment table that maintains linkage to the target dataset. Attachments are added to the target dataset using a match table that dictates for each input record (or an attribute group of records) the path to a file to add as an attachment to that record.</para>
    /// <para>将文件附件添加到地理数据库要素类或表的记录中。附件存储在地理数据库内部的单独附件表中，用于维护与目标数据集的链接。使用匹配表将附件添加到目标数据集中，该匹配表为每个输入记录（或记录的属性组）指定要作为附件添加到该记录的文件的路径。</para>
    /// </summary>    
    [DisplayName("Add Attachments")]
    public class AddAttachments : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddAttachments()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_dataset">
        /// <para>Input Dataset</para>
        /// <para><xdoc>
        ///   <para>Geodatabase table or feature class to add attachments to. Attachments are not added directly to this table, but rather to a related attachment table that maintains linkage to the input dataset.</para>
        ///   <para>The input dataset must be stored in a version 10.0 or later geodatabase, and the table must have attachments enabled.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要向其添加附件的地理数据库表或要素类。附件不会直接添加到此表中，而是添加到与输入数据集保持链接的相关附件表中。</para>
        ///   <para>输入数据集必须存储在 10.0 或更高版本的地理数据库中，并且表必须启用附件。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_join_field">
        /// <para>Input Join Field</para>
        /// <para>Field from the Input Dataset that has values that match the values in the Match Join Field. Records that have join field values that match between the Input Dataset and the Match Table will have attachments added. This field can be an Object ID field or any other identifying attribute.</para>
        /// <para>输入数据集中的字段，其值与匹配连接字段中的值匹配。如果记录的连接字段值在输入数据集和匹配表之间匹配，则将添加附件。此字段可以是“对象 ID”字段或任何其他标识属性。</para>
        /// </param>
        /// <param name="_in_match_table">
        /// <para>Match Table</para>
        /// <para>Table that identifies which input records will have attachments added and the paths to those attachments.</para>
        /// <para>用于标识将添加附件的输入记录以及这些附件的路径的表。</para>
        /// </param>
        /// <param name="_in_match_join_field">
        /// <para>Match Join Field</para>
        /// <para>Field from the match table that indicates which records in the Input Dataset will have specified attachments added. This field can have values that match Input Dataset Object IDs or some other identifying attribute.</para>
        /// <para>匹配表中的字段，用于指示输入数据集中的哪些记录将添加指定的附件。此字段的值可以与输入数据集对象 ID 或其他一些标识属性匹配。</para>
        /// </param>
        /// <param name="_in_match_path_field">
        /// <para>Match Path Field</para>
        /// <para>Field from the match table that contains paths to the attachments to add to Input Dataset records.</para>
        /// <para>匹配表中的字段，其中包含要添加到输入数据集记录的附件的路径。</para>
        /// </param>
        public AddAttachments(object _in_dataset, object _in_join_field, object _in_match_table, object _in_match_join_field, object _in_match_path_field)
        {
            this._in_dataset = _in_dataset;
            this._in_join_field = _in_join_field;
            this._in_match_table = _in_match_table;
            this._in_match_join_field = _in_match_join_field;
            this._in_match_path_field = _in_match_path_field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Add Attachments";

        public override string CallName => "management.AddAttachments";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_dataset, _in_join_field, _in_match_table, _in_match_join_field, _in_match_path_field, _in_working_folder, _out_dataset];

        /// <summary>
        /// <para>Input Dataset</para>
        /// <para><xdoc>
        ///   <para>Geodatabase table or feature class to add attachments to. Attachments are not added directly to this table, but rather to a related attachment table that maintains linkage to the input dataset.</para>
        ///   <para>The input dataset must be stored in a version 10.0 or later geodatabase, and the table must have attachments enabled.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要向其添加附件的地理数据库表或要素类。附件不会直接添加到此表中，而是添加到与输入数据集保持链接的相关附件表中。</para>
        ///   <para>输入数据集必须存储在 10.0 或更高版本的地理数据库中，并且表必须启用附件。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_dataset { get; set; }


        /// <summary>
        /// <para>Input Join Field</para>
        /// <para>Field from the Input Dataset that has values that match the values in the Match Join Field. Records that have join field values that match between the Input Dataset and the Match Table will have attachments added. This field can be an Object ID field or any other identifying attribute.</para>
        /// <para>输入数据集中的字段，其值与匹配连接字段中的值匹配。如果记录的连接字段值在输入数据集和匹配表之间匹配，则将添加附件。此字段可以是“对象 ID”字段或任何其他标识属性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Join Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_join_field { get; set; }


        /// <summary>
        /// <para>Match Table</para>
        /// <para>Table that identifies which input records will have attachments added and the paths to those attachments.</para>
        /// <para>用于标识将添加附件的输入记录以及这些附件的路径的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Match Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_match_table { get; set; }


        /// <summary>
        /// <para>Match Join Field</para>
        /// <para>Field from the match table that indicates which records in the Input Dataset will have specified attachments added. This field can have values that match Input Dataset Object IDs or some other identifying attribute.</para>
        /// <para>匹配表中的字段，用于指示输入数据集中的哪些记录将添加指定的附件。此字段的值可以与输入数据集对象 ID 或其他一些标识属性匹配。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Match Join Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_match_join_field { get; set; }


        /// <summary>
        /// <para>Match Path Field</para>
        /// <para>Field from the match table that contains paths to the attachments to add to Input Dataset records.</para>
        /// <para>匹配表中的字段，其中包含要添加到输入数据集记录的附件的路径。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Match Path Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_match_path_field { get; set; }


        /// <summary>
        /// <para>Working Folder</para>
        /// <para><xdoc>
        ///   <para>Folder or workspace where attachment files are centralized. By specifying a working folder, the paths in the Match Path Field can be the short names of files relative to the working folder.</para>
        ///   <para>For example, if loading attachments with paths like C:\MyPictures\image1.jpg, C:\MyPictures\image2.jpg, set the Working Folder to C:\MyPictures, then paths in the Match Path Field can be the short names such as image1.jpg and image2.jpg, instead of the longer full paths.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>集中存放附件文件的文件夹或工作区。通过指定工作文件夹，“匹配路径”字段中的路径可以是相对于工作文件夹的文件的短名称。</para>
        ///   <para>例如，如果加载路径为 C：\MyPictures\image1.jpg、C：\MyPictures\image2.jpg 的附件，请将“工作文件夹”设置为“C：\MyPictures”，则“匹配路径”字段中的路径可以是短名称（如 image1.jpg 和 image2.jpg），而不是较长的完整路径。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Working Folder")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_working_folder { get; set; } = null;


        /// <summary>
        /// <para>Updated Input Dataset</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_dataset { get; set; }


        public AddAttachments SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}